The invention relates generally to the rapid, high resolution inspection of circuit boards using a computerized laminography system, and in particular, to systems which automatically determine the relative distance between a solder joint elevation and a circuit board surface elevation using a laminographic image of the solder joint and a surface map of the circuit board.
Rapid and precise quality control inspections of the soldering and assembly of electronic devices have become priority items in the electronics manufacturing industry. The reduced size of components and solder connections, the resulting increased density of components on circuit boards and the advent of surface mount technology (SMT), which places solder connections underneath device packages where they are hidden from view, have made rapid and precise inspections of electronic devices and the electrical connections between devices very difficult to perform in a manufacturing environment.
Many existing inspection systems for electronic devices and connections make use of penetrating radiation to form images which exhibit features representative of the internal structure of the devices and connections. These systems often utilize conventional radiographic techniques wherein the penetrating radiation comprises X-rays. Medical X-ray pictures of various parts of the human body, e.g., the chest, arms, legs, spine, etc., are perhaps the most familiar examples of conventional radiographic images. The images or pictures formed represent the X-ray shadow cast by an object being inspected when it is illuminated by a beam of X-rays. The X-ray shadow is detected and recorded by an X-ray sensitive material such as film or other suitable means.
The appearance of the X-ray shadow or radiograph is determined not only by the internal structural characteristics of the object, but also by the direction from which the incident X-rays strike the object. Therefore, a complete interpretation and analysis of X-ray shadow images, whether performed visually by a person or numerically by a computer, often requires that certain assumptions be made regarding the characteristics of the object and its orientation with respect to the X-ray beam. For example, it is often necessary to make specific assumptions regarding the shape, internal structure, etc. of the object and the direction of the incident X-rays upon the object. Based on these assumptions, features of the X-ray image may be analyzed to determine the location, size, shape, etc., of the corresponding structural characteristic of the object, e.g., a defect in a solder connection, which produced the image feature. These assumptions often create ambiguities which degrade the reliability of the interpretation of the images and the decisions based upon the analysis of the X-ray shadow images. One of the primary ambiguities resulting from the use of such assumptions in the analysis of conventional radiographs is that small variations of a structural characteristic within an object, such as the shape, density and size of a defect within a solder connection, are often masked by the overshadowing mass of the solder connection itself as well as by neighboring solder connections, electronic devices, circuit boards and other objects. Since the overshadowing mass and neighboring objects are usually different for each solder joint, it is extremely cumbersome and often nearly impossible to make enough assumptions to precisely determine shapes, sizes and locations of solder defects within individual solder joints.
In an attempt to compensate for these shortcomings, some systems incorporate the capability of viewing the object from a plurality of angles. The additional views enable these systems to partially resolve the ambiguities present in the X-ray shadow projection images. However, utilization of multiple viewing angles necessitates a complicated mechanical handling system, often requiring as many as five independent, non-orthogonal axes of motion. This degree of mechanical complication leads to increased expense, increased size and weight, longer inspection times, reduced throughput, impaired positioning precision due to the mechanical complications, and calibration and computer control complications due to the non-orthogonality of the axes of motion.
Many of the problems associated with the conventional radiography techniques discussed above may be alleviated by producing cross-sectional images of the object being inspected. Tomographic techniques such as laminography and computed tomography (CT) have been used in medical applications to produce cross-sectional or body section images. In medical applications, these techniques have met with widespread success, largely because relatively low resolution on the order of one or two millimeters (0.04 to 0.08 inches) is satisfactory and because speed and throughput requirements are not as severe as the corresponding industrial requirements.
In the case of electronics inspection, and more particularly, for inspection of electrical connections such as solder joints, image resolution on the order of several micrometers, for example, 20 micrometers (0.0008 inches) is preferred. Furthermore, an industrial solder joint inspection system must generate multiple images per second in order to be practical for use on an industrial production line. Laminography systems which are capable of achieving the speed and accuracy requirements necessary for electronics inspection are described in the following patents: 1) U.S. Pat. No. 4,926,452 entitled xe2x80x9cAUTOMATED LAMINOGRAPHY SYSTEM FOR INSPECTION OF ELECTRONICSxe2x80x9d, issued to Baker et al.; 2) U.S. Pat. No. 5,097,492 entitled xe2x80x9cAUTOMATED LAMINOGRAPHY SYSTEM FOR INSPECTION OF ELECTRONICSxe2x80x9d, issued to Baker et al.; 3) U.S. Pat. No. 5,081,656 entitled xe2x80x9cAUTOMATED LAMINOGRAPHY SYSTEM FOR INSPECTION OF ELECTRONICSxe2x80x9d, issued to Baker et al.; 4) U.S. Pat. No. 5,291,535 entitled xe2x80x9cMETHOD AND APPARATUS FOR DETECTING EXCESS/INSUFFICIENT SOLDER DEFECTSxe2x80x9d, issued to Baker et al.; 5) U.S. Pat. No. 5,621,811 entitled xe2x80x9cLEARNING METHOD AND APPARATUS FOR DETECTING AND CONTROLLING SOLDER DEFECTSxe2x80x9d, issued to Roder et al.; 6) U.S. Pat. No. 5,561,696 xe2x80x9cMETHOD and APPARATUS FOR INSPECTING ELECTRICAL CONNECTIONSxe2x80x9d, issued to Adams et al.; 7) U.S. Pat. No. 5,199,054 entitled xe2x80x9cMETHOD AND APPARATUS FOR HIGH RESOLUTION INSPECTION OF ELECTRONIC ITEMSxe2x80x9d, issued to Adams et al.; 8) U.S. Pat. No. 5,259,012 entitled xe2x80x9cLAMINOGRAPHY SYSTEM AND METHOD WITH ELECTROMAGNETICALLY DIRECTED MULTIPATH RADIATION SOURCExe2x80x9d, issued to Baker et al.; 9) U.S. Pat. No. 5,583,904 entitled xe2x80x9cCONTINUOUS LINEAR SCAN LAMINOGRAPHY SYSTEM AND METHODxe2x80x9d, issued to Adams; and 10) U.S. Pat. No. 5,687,209 entitled xe2x80x9cAUTOMATIC WARP COMPENSATION FOR LAMINOGRAPHIC CIRCUIT BOARD INSPECTIONxe2x80x9d, issued to Adams. The entirety of each of the above referenced patents is hereby incorporated herein by reference.
In a laminography system which views a fixed object and has an imaging area which is smaller than the object being inspected, it may be necessary to move the object around to position different regions of the object within the imaging area thus generating multiple laminographs which, when pieced together form an image of the entire object. This is frequently achieved by supporting the object on a mechanical handling system, such as an X,Y,Z positioning table. The table is then moved to bring the desired regions of the object into the imaging area. Movement in the X and Y directions locates the region to be examined, while movement in the Z direction moves the object up and down to select the plane within the object where the cross sectional image is to be taken.
Several of the above referenced patents disclose devices and methods for the generation of cross-sectional images of test objects at a fixed or selectable cross-sectional image focal plane. In these systems, an X-ray source system and an X-Ray detector system are separated in the xe2x80x9cZxe2x80x9d axis direction by a fixed distance and the cross-sectional image focal plane is located at a predetermined specific position in the xe2x80x9cZxe2x80x9d axis direction which is intermediate the positions of the X-ray source system and the X-ray detector system along the xe2x80x9cZxe2x80x9d axis. The X-Ray detector system collects data from which a cross-sectional image of features in the test object, located at the cross-sectional image focal plane, can be formed. All of these systems postulate that the features desired to be imaged are located in the fixed or selectable cross-sectional image focal plane at the predetermined specific position along the xe2x80x9cZxe2x80x9d axis. Thus, in these systems, it is essential that the positions of the cross-sectional image focal plane and the plane within the object which is desired to be imaged, be configured to coincide at the same position along the xe2x80x9cZxe2x80x9d axis. If this condition is not met, then the desired image of the selected feature within the test object will not be acquired. Instead, a cross-sectional image of a plane within the test object which is either above or below the plane which includes the selected feature will be acquired.
Presently, one technique commonly used for positioning the selected feature of the test object within the cross-sectional image focal plane physically measures the xe2x80x9cZxe2x80x9d axis position of the selected feature. Using this measurement, the test object is then positioned along the xe2x80x9cZxe2x80x9d axis such that the selected feature coincides with the xe2x80x9cZxe2x80x9d axis position of the cross-sectional image focal plane. Any of a variety of standard methods and instruments may be used to physically measure the xe2x80x9cZxe2x80x9d axis position of the selected feature of the test object. There are several types of commercially available Z-ranging systems which are used to determine the distance between a known location in xe2x80x9cZxe2x80x9d and a feature on the surface, or just below the surface, of the test object. Such systems are as simple as mechanical fixturing of the test object, a mechanical probe, a laser based optical triangulation system, an optical interferometric system, an ultrasonic system, or any other type of measuration device that is suitable. Any one of these xe2x80x9cZxe2x80x9d distance measuring systems is typically used to form a xe2x80x9cZ-mapxe2x80x9d of the surface of the test object. The Z-map typically consists of an X and Y array of the Z-values of the surface of the test object. The (X,Y) locations being points on a plane of the test object which is substantially parallel to the cross-sectional image focal plane. The systems most commonly used in systems for cross-sectional image formation of features on circuit boards have been laser based triangulation range finders.
Range finders have been used in particular for cross-sectional X-ray image systems that are used to image electronic circuit board assemblies. Circuit board assemblies are typically very thin in comparison to the surface area in which the components are mounted. Some circuit assemblies are made with very dimensionally stable material, such as ceramic substrates. However, the majority of circuit board assemblies are constructed with board material that is somewhat flexible or in some cases very flexible. This flexibility allows the board to develop a warp in the axis perpendicular to the major surface areas. Additionally, some circuit board assemblies have variations in board thickness. Besides electronic assemblies, there are many other objects that have dimensional variation on a scale that is significant when compared to the depth of field of the xe2x80x9cZxe2x80x9d focal plane in cross-sectional X-ray imaging. By measuring the surface of a warped test object, means can then often be used to properly adjust the positional relationship of the test object with respect to the xe2x80x9cZxe2x80x9d focal plane of the cross-sectional imaging system so that the desired image of the features of interest within the test object can be imaged.
Specifically, one such range finder system is designed for use in a system such as that described in U.S. Pat. No. 4,926,452 to Baker, et al. Baker et al. discloses a laminography system in which an X-ray based imaging system having a very shallow depth of field is used to examine solid objects such as printed circuit cards. The shallow depth of field provides a means for examining the integrity of a solder joint without interference from the components above and below the solder joint. The material above and below the solder joint is out of focus, and hence, contributes to a more or less uniform background. To provide the needed selectivity, the depth of field of the laminographic imaging system is on the order of less than approximately 2 mils. Unfortunately, surface variations on the printed circuit card often exceed this tolerance. To overcome this drawback, the surface of the printed circuit card is mapped using a laser range finder. The detailed laser range finder map is then used to position the circuit card with respect to the X-ray imaging system such that the component of interest is in focus even when the card is translated from one field of interest to another.
One disadvantage of most laser ranging systems is that they require that the surface being mapped be free of imperfections which can interfere with the laser beam. Two types of commercially available ranging systems are often used. Both types operate by illuminating a point on the surface with a collimated beam of light from a laser. In the first type of system, the laser beam strikes the surface at right angles to the surface and illuminates a small spot on the surface. The illuminated spot is imaged onto an array of detectors by a lens. The distance from the laser to the surface determines the degree to which the illuminated spot is displaced from the axis of the lens. As a result, as the distance changes, the image of the spot moves along the array of detectors. The identity of the detector on which the projected spot falls provides the information needed to determine the distance to the point on the surface. In this type of system, imperfections on the surface can interfere with the laser beam at the point of measurement resulting in substantial errors in the measurement. In more sophisticated versions of this type of system, the image of the laser spot falls on more than one detector. The detection circuitry computes the center of the image to provide a more precise distance determination. Here, imperfections in the surface that distort the image on the detector array will also cause errors even though the height of the imperfection is insufficient to cause a significant distance error. The second type of system assumes that the surface is flat and reflective. In this type of system, the laser beam is directed at the surface of the circuit board at an oblique angle and reflected from the surface onto the detector array without an imaging lens. The distance is then measured by identifying the detector receiving the reflected light beam. The distance measurement relies on a knowledge of the angle of incidence of the laser beam with respect to the surface. If the surface includes an imperfection which has dimensions similar to that of the laser beam, this assumption will not be satisfied, since the surface of the imperfection will determine the angle of incidence. The resulting errors can be much larger than the height of the imperfection in this type of system. In principle, the problems introduced by such imperfections could be mitigated by increasing the diameter of the laser beam. Unfortunately, the diameter of the laser beam must be kept to a minimum to provide the required accuracy in the range measurement. Laser range finding measurements are also made using a CCD camera which views the surface and an image analyzer which analyzes the image acquired by the CCD camera.
Another disadvantage of existing Z-map systems is the possibility that the desired features to be measured are not in strict mechanical relationship to the Z-map surface of the test object. This can occur, for example, when the desired feature to be imaged is on the opposite side from the Z-map surface, of a double-sided circuit board assembly that has a significant variation in board thickness. To compensate for this effect, existing cross-sectional imaging systems would have to generate a Z-map of both sides of a test object at added time and complexity. There is also the possibility that the feature to be imaged in the test object is internal to the test object at a Z distance from the Z-map surface of the board, with significant variation in this distance from board to board or within the same board. Additionally, warpage of the circuit board may not be adequately measured by the Z-map of the surface of the board.
For solder joint inspections, some of the inaccuracies inherent in laser created Z-maps of the surface of a circuit board are partially compensated for by measuring xe2x80x9cDelta Zxe2x80x9d values. Delta Z values are intended to represent the distance between the actual Z elevations of the solder pads and the Z elevation values determined via the laser readings. Currently, laser surface map points are each given a Delta Z value through a tedious and error prone method. This involves the user attempting to manually focus on a feature which is near the laser surface map point and determining the Z elevation of that feature. Delta Z is then defined as the difference between the user determined Z elevation and the laser determined Z elevation for that location. In many cases, it may be necessary for the user to repeat this process for numerous locations on the circuit board. There are several significant problems with this approach, including the following. A) The manual focus technique is subjective and error prone. B) There must be something suitable for the user to focus on near the laser map point. Frequently there is not, so the user will migrate far from the laser map point to find something to focus on, yielding an inaccurate Delta Z value. C) The assumption is often made that the circuit board is perfectly flat within the triangles formed by the laser map points. Frequently, it is difficult to supply enough points in certain areas to accurately model warpage of the circuit board. D) There is no way in this method to handle consistent variations in circuit board thickness. For example, many circuit boards have certain areas which are typically thicker than other areas of the board. E) There is no way to map the bottom of the circuit board since there is no bottom laser.
In summary, accurate inspection of a solder joint using a cross-sectional image(s) of the solder joint requires that the vertical position, i.e., Z-axis location, within the solder joint at which the cross-sectional image(s) is to be acquired be accurately known. The surface of the circuit board on which the solder joint is located often provides a convenient reference plane from which vertical positions within the solder joint may be determined. Presently, laser range finding technology is often used to create a surface map of the circuit board. However, due to a variety of factors, several of which are discussed above, the laser determined Z values do not permit accurate determination of the actual Z-axis locations of the solder joints being inspected.
The present invention provides improvements which address the above listed specific problems. Particularly important is that it both removes the tedious and error prone method of manually setting laser Delta Z values, while supplying correct Z values for each board view in cases where board warpage is consistent within the surface map triangles.
Several advantages of the present invention include: ease of use; improved accuracy of Z elevation determination; ability to handle consistent board thickness variations in certain areas of the circuit board; and ability to model board warpage more accurately. Additionally, since the present invention is compatible with the currently used manual technique, it can be used on an as needed basis. Thus, it is possible to use the old manually set Delta Z values in cases where it is not desired to use the new method.
Accordingly, one object of the present invention is to improve the accuracy of the Z-map systems used in the prior art, for example, laser range finding systems, with a system that automatically compensates for test object warpage without requiring additional system hardware over that hardware which is required to form the X-ray laminographic cross-sectional image.
Another object and advantage of the present invention is that it provides an improved way to produce high resolution cross sectional images of electrical connections.
As used throughout, the phrase xe2x80x9cboard viewxe2x80x9d refers to an image of a particular region or area of a circuit board identified by a specific x,y coordinate of the circuit board. Since the area imaged by a typical laminograpy system is smaller than a typical circuit board, each xe2x80x9cboard viewxe2x80x9d includes only a portion of the circuit board. Thus, the circuit board is generally moved around to different positions thereby placing different regions of the circuit board within the imaging area of the system. A complete inspection of a circuit board includes multiple xe2x80x9cboard viewsxe2x80x9d, i.e., laminographic images, which, if pieced together would form an image of the entire circuit board or selected regions of the circuit board requiring inspection.
The present invention comprises a greatly improved computerized laminography system which provides more accurate determination of the Z elevations of solder joints to be inspected.
The present invention includes a technique for automatically learning a Delta Z value for every solder joint on a circuit board during initial board setup. This is done through an automatic analysis of X-ray image focus or other image quality parameter. The machine creates multiple laminographic image slices through the approximate board surface and determines the Z elevation of every solder joint relative to a surface map of the board.
After each joint Delta Z is determined, a program then calculates a Delta Z for each board view using all of the joint Delta Z values within that board view. There are several ways this can be done, such as averaging, or throwing out outliers, etc. This method is also extensible to actually determine that within a particular board view, board warpage is such that some joints may require a different slice within the board view.
All of the joint Delta Z values are stored before calculating a Delta Z value for the board view which includes those joints. This is advantageous in case minor CAD changes change the locations of the board views. Since the Delta Z for each joint has already been measured and saved, it is a simple matter to recalculate a new Delta Z value for the new board view using the new board view joint lists and the stored Delta Z values for the joints located within the new board view.
In a first aspect, the present invention is a device for inspecting electrical connections on a circuit board comprising: a source of X-rays which emits X-rays through the electrical connection from a plurality of positions; an X-ray detector system positioned to receive the X-rays produced by the source of X-rays which have penetrated the electrical connection, the X-ray detector system further comprising an output which emits data signals corresponding to an X-ray image of the electrical connection produced by the X-rays received and detected by the X-ray detector after penetrating the electrical connection; an image memory which combines the detector data signals to form an image database which contains information sufficient to form a cross-sectional image of a cutting plane of the electrical connection at an image plane; and a processor which controls the acquisition of the cross-sectional image and analyzes the cross-sectional image, the image processor further comprising: a Z-axis controller for varying a Delta Z value, i.e., the Z-axis distance between the image plane and a reference Z-axis position, and acquiring a plurality of Delta Z images of the electrical connection at a plurality of the Delta Z values; an image gradient section which calculates and stores a plurality of gradients for each of the plurality of Delta Z images; a variance calculator section which determines a variance of the plurality of gradients for each of the plurality of Delta Z images; and a comparator which compares the variances of the gradients for each of the plurality of Delta Z images. The device may further include a surface mapper for creating a surface map of the circuit board. In some configurations, the surface mapper further comprises a laser range finder for determining reference Z-axis values for a plurality of points on the circuit board thereby creating a laser surface map of the circuit board. The image gradient may be approximated over a Kxc3x97K pixel grid by the following relation:
GMR[f(xy)]≅/f(xxe2x88x92N,yxe2x88x92N)xe2x88x92f(x+M,y+M)/+/f(x+M,yxe2x88x92N)xe2x88x92f(xxe2x88x92N,y+M)/ 
where f(x,y) represents a gray value of a pixel located at x,y; K is an integer which is greater than or equal to 2; N=(Kxe2x88x921)/2 rounded down to the nearest integer; and M=Kxe2x88x92Nxe2x88x921. In some configurations, the comparator further comprises means for fitting the variances of the plurality of gradients for each of the plurality of Delta Z images with either one of a parabolic curve or a Gaussian curve. Additionally, the comparator may further comprise means for determining a Delta Z value corresponding to a maximum value of the parabolic curve or the Gaussian curve. In some configurations, the source of X-rays comprises a plurality of X-ray sources and the X-ray detector system comprises a plurality of X-ray detectors. The processor may further comprise an image section which produces the cross-sectional image of a cutting plane of the electrical connection from the image database.
A second aspect of the present invention is a method of determining the Z-axis position of an electrical connection on a circuit board comprising the steps of: determining a reference Z-axis position, ZRF; acquiring a first cross sectional image of the electrical connection at a first Z-axis position, ZRF+xc3x84Z1, and a second cross sectional image of the electrical connection at a second Z-axis position, ZRF+xc3x84Z2; determining a first plurality of gradients for the first cross sectional image and a second plurality of gradients for the second cross sectional image; calculating a first variance for the first plurality of gradients corresponding to the first cross sectional image at the first Z-axis position, ZRF+xc3x84Z1, and a second variance for the second plurality of gradients corresponding to the second cross sectional image at the second Z-axis position, ZRF+xc3x84Z2; and analyzing the first and second variances and deriving therefrom the Z-axis position of the electrical connection. In certain configurations, the reference Z-axis position is determined with a range finder which may further include a laser range finder.
A third aspect of the present invention includes a method of determining the Z-axis position of an electrical connection on a circuit board comprising the steps of: determining a reference Z-axis position, ZRF; acquiring a first cross sectional image of the electrical connection at a first Z-axis position, ZRF+xc3x84Z1, a second cross sectional image of the electrical connection at a second Z-axis position, ZRF+AZ2, and a third cross sectional image of the electrical connection at a third Z-axis position, ZRF+xc3x84Z3; determining a first plurality of gradients for the first cross sectional image, a second plurality of gradients for the second cross sectional image and a third plurality of gradients for the third cross sectional image; calculating a first variance for the first plurality of gradients corresponding to the first cross sectional image at the first Z-axis position, ZRF+xc3x84Z1, a second variance for the second plurality of gradients corresponding to the second cross sectional image at the second Z-axis position, ZRF+xc3x84Z2, and third variance for the third plurality of gradients corresponding to the third cross sectional image at the third Z-axis position, ZRF+xc3x84Z3; and determining a maximum variance value derived from the first, second and third variances and selecting a corresponding Z-axis position, ZRF+xc3x84ZMAX, corresponding to the maximum variance value, as the Z-axis position of the electrical connection. The method may further include the step of determining a mathematical function which includes points which approximate the values of the first, second and third variances. In some cases, the mathematical function is a parabola, while in other cases the mathematical function is a Gaussian. This aspect of the invention may further include a surface mapper for creating a surface map of the circuit board.
In a fourth aspect, the present invention is a device for inspecting electrical connections on a circuit board comprising: means for determining a reference Z-axis position, ZRF; means for acquiring a first cross sectional image of the electrical connection at a first Z-axis position, ZRF+xc3x84Z1, a second cross sectional image of the electrical connection at a second Z-axis position, ZRF+Z2, and a third cross sectional image of the electrical connection at a third Z-axis position, ZRF+xc3x84Z3; means for determining a first plurality of gradients for the first cross sectional image, a second plurality of gradients for the second cross sectional image and a third plurality of gradients for the third cross sectional image; means for calculating a first variance for the first plurality of gradients corresponding to the first cross sectional image at the first Z-axis position, ZRF+xc3x84Z1, a second variance for the second plurality of gradients corresponding to the second cross sectional image at the second Z-axis position, ZRF+xc3x84Z2, and third variance for the third plurality of gradients corresponding to the third cross sectional image at the third Z-axis position, ZRF+xc3x84Z3; and means for determining a maximum variance value derived from the first, second and third variances and selecting a corresponding Z-axis position, ZRF+xc3x84ZMAX, corresponding to the maximum variance value, as the Z-axis position of the electrical connection. This device may further include means for determining a mathematical function which includes points which approximate the values of the first, second and third variances wherein the Z-axis position, ZRF+xc3x84ZMAX, corresponding to the maximum variance value equals a Z-axis position which corresponds to a maximum value of the mathematical function. The mathematical function may be one of a parabola or a Gaussian. In some configurations, the means for determining the reference Z-axis position further comprises a laser range finder.
In a fifth aspect, the invention includes a method for inspecting electrical connections on a circuit board comprising the steps of: determining a Z-axis position for substantially all of the electrical connections on the circuit board; storing the Z-axis positions for substantially all of the electrical connections on the circuit board in a data base; selecting a first board view which includes a first portion of the circuit board; and deriving from the stored values of the Z-axis positions for the electrical connections included within the first board view, a Z-axis position for the first board view. The method may further include the step of creating a surface map of the circuit board with a range finder. In some configurations, the method further includes the steps of: selecting a second board view which includes a second portion of the circuit board; and deriving from the stored values of the Z-axis positions for the electrical connections included within the second board view, a Z-axis position for the second board view.
In a sixth aspect, the invention is a method for determining the Z-axis position of an electrical connection on a circuit board comprising the steps of: acquiring two or more cross sectional images, at two or more Z-axis positions, of an area of the circuit board which includes the electrical connection; and comparing and analyzing the two or more cross sectional images at the two or more Z-axis positions, and deriving therefrom the Z-axis position of the electrical connection. This method may further include the step of determining a reference Z-axis position, ZRF. In some configurations, the method further comprises the steps of: acquiring a first cross sectional image of the electrical connection at a first Z-axis position, ZRF+xc3x84Z1, and a second cross sectional image of the electrical connection at a second Z-axis position, ZRF+xc3x84Z2; determining a first plurality of gradients for the first cross sectional image and a second plurality of gradients for the second cross sectional image; calculating a first variance for the first plurality of gradients corresponding to the first cross sectional image at the first Z-axis position, ZRF+xc3x84Z1, and a second variance for the second plurality of gradients corresponding to the second cross sectional image at the second Z-axis position, ZRF+xc3x84Z2; and analyzing the first and second variances and deriving therefrom the Z-axis position of the electrical connection. In this method, the image gradients may be approximated over a Kxc3x97K pixel grid by the following relation:
GMR[f(x,y)]≅/f(xxe2x88x92N,yxe2x88x92N)xe2x88x92f(x+M,y+M)/+/f(x+M,yxe2x88x92N)xe2x88x92f(xxe2x88x92N,y+M)/ 
where f(x,y) represents a gray value of a pixel located at x,y; K is an integer which is greater than or equal to 2; N=(Kxe2x88x921)/2 rounded down to the nearest integer; and M=Kxe2x88x92Nxe2x88x921. In some configurations, the reference Z-axis position is determined with a range finder which may include a laser range finder. The method may further include the steps of: determining a Z-axis position for substantially all of the electrical connections on the circuit board; storing the Z-axis positions for substantially all of the electrical connections on the circuit board in a data base; selecting a first board view which includes a first portion of the circuit board; and deriving from the stored values of the Z-axis positions for the electrical connections included within the first board view, a Z-axis position for the first board view.
In a seventh aspect, the invention is a device for inspecting electrical connections on a circuit board comprising: means for acquiring two or more cross sectional images, at two or more Z-axis positions, of an area of the circuit board which includes the electrical connection; and means for comparing and analyzing the two or more cross sectional images at the two or more Z-axis positions, and deriving therefrom the Z-axis position of the electrical connection. In some configurations, the device further comprises: means for determining a reference Z-axis position, ZRF; means for acquiring a first cross sectional image of the electrical connection at a first Z-axis position, ZRF+xc3x84Z1, a second cross sectional image of the electrical connection at a second Z-axis position, ZRF+xc3x84Z2, and a third cross sectional image of the electrical connection at a third Z-axis position, ZRF+xc3x84Z3; means for determining a first plurality of gradients for the first cross sectional image, a second plurality of gradients for the second cross sectional image and a third plurality of gradients for the third cross sectional image; means for calculating a first variance for the first plurality of gradients corresponding to the first cross sectional image at the first Z-axis position, ZRF+xc3x84Z1, a second variance for the second plurality of gradients corresponding to the second cross sectional image at the second Z-axis position, ZRF+xc3x84Z2, and third variance for the third plurality of gradients corresponding to the third cross sectional image at the third Z-axis position, ZRF+xc3x84Z3; and means for determining a maximum variance value derived from the first, second and third variances and selecting a corresponding Z-axis position, ZRF+xc3x84ZMAX, corresponding to the maximum variance value, as the Z-axis position of the electrical connection. In some configurations, this device may further comprise a surface mapper for creating a surface map of the circuit board.
These and other characteristics of the present invention will become apparent through reference to the following detailed description of the preferred embodiments and accompanying drawings.